# Contributor: Roberto Oliveira <robertoguimaraes8@gmail.com>
# Maintainer: Roberto Oliveira <robertoguimaraes8@gmail.com>
pkgname=monetdb
_pkgname=MonetDB
pkgver=11.33.11
pkgrel=4
pkgdesc="Column-oriented database management system"
url="https://www.monetdb.org/Home"
arch="all"
license="MPL-1.1"
makedepends="musl-dev gcc bison make openssl-dev>3 libxml2-dev xz-dev
	bzip2-dev lz4-dev readline-dev snappy-dev curl-dev pcre-dev unixodbc-dev
	libatomic_ops-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://www.monetdb.org/downloads/sources/archive/$_pkgname-$pkgver.tar.xz
	fix-definitions-musl.patch"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
       default_prepare
       # config.sub is too old to recognize loongarch64 system
       update_config_guess
       update_config_sub
}

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	 make DESTDIR="$pkgdir" install

	 rm -r "$pkgdir"/usr/lib/systemd
}

sha512sums="1f841a9c5455faf14840608ddb570d70374989c2371a6dcb9044c3e66f4de722f123bd89adca28e3193ecbbe16fb4fd184ee622ce47fbb59076d230c14b18b4f  MonetDB-11.33.11.tar.xz
c705b33fecfdfc503621960bccf0bd03af66e9c2d213538daf8e59c2c351c6f98ddfd7325df6036d3de71d156953a21d19c10cbadd4a8b8de63297bdc1d86198  fix-definitions-musl.patch"
